package community;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EntityScan(basePackages = {"community.domain.model", "user.domain.model"})  // 指定扫描 User 类所在的包路径
//@EnableJpaRepositories(basePackages = {"community.infrastructure.repository", "user.domain.repository"})
@EnableJpaRepositories(basePackages = {"community.infrastructure.repository", "user.infrastructure.repository"})  // 确保扫描到 community 和 user 模块的 Spring Data JPA repository
@ComponentScan(basePackages = {"community", "user.infrastructure.repository"})
public class AgricultureCommunityApplication {
    public static void main(String[] args) {
        SpringApplication.run(AgricultureCommunityApplication.class, args);
    }
}
